<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <title>弹窗示例</title>
    <style>
        .popup-container {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: #f5f5f5;
            padding: 20px;
            border: 2px solid #ccc;
            border-radius: 5px;
            box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.3);
            z-index: 9999;
        }

        .popup-container input {
            margin-bottom: 10px;
        }

        .popup-container button {
            padding: 8px 16px;
        }
    </style>
</head>
<body>
    <button onclick="openPopup()">点击打开弹窗</button>
    <div class="popup-container" id="popupContainer">
        <h2>请输入您的姓名</h2>
        <input type="text" id="nameInput">
        <button onclick="saveName()">保存</button>
    </div>
    <div id="nameDisplay"></div>

    <script src="script.js"></script>
</body>
</html>